package com.player.thirdGroup.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author VULCAN
 * @create 2019-12-27 21:02
 * @desc 账号表
 **/
@Entity
@Data
@Table(name = "sys_user")
public class User implements Serializable {
    @Id
    @Column(name = "user_id")
    private String userid;
    @Column(name = "user_name")
    private String username;
    @Column(name = "user_img")
    private String userimg;
    @Column(name = "user_status")
    private String userstatus;
    @Column(name = "user_cdate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date usercdate;
    @Column(name = "user_pwd")
    private String userpwd;
    @Column(name = "user_phone")
    private String userphone;
    @Column(name = "user_login_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date userlogindate;
    @ManyToMany(mappedBy ="users")
    private List<Role> roles;

    @Transient
    private String roleId;
}
